#include <stdbool.h>

typedef struct {
    int x;
    int y;
    bool exploding; 
} Bullet;

struct timespec timer;

Bullet create_bullet(int startX, int startY){
    Bullet bullet;
    bullet.x = startX;
    bullet.y = startY;
    bullet.exploding = false;
    
    return bullet;
}

void move_bullet(Bullet* b){
    if(is_timer_ready(timer) && !(b->exploding)){
        if(b->y > 0)
            b->y -= 1;
        
        reset_timer(&timer);
    }
}

bool should_remove(const Bullet *bullet){
   return ((bullet->exploding && is_timer_ready(timer)) || bullet->y <= 0 );
}
